/**
 * 
 */
package service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import dao.jpa.DroneDao;
import domain.Drone;

/**
 * @author root
 * 
 */
@Service("droneService")
@Transactional
public class DroneServiceImpl implements DroneService {

	private DroneDao droneDao;

	@Autowired
	public void setDroneDao(DroneDao droneDao) {
		this.droneDao = droneDao;
	}

	@Override
	public void saveDrone(Drone drone) {
		droneDao.createAndSaveDrone(drone);

	}

	@Override
	public List<Drone> getAllDrons() {
		return droneDao.getAllDrone();
	}

	@Override
	public Drone getDroneById(String id) {
		return droneDao.getDroneById(id);
	}

	@Override
	public void deleteDrone(Drone drone) {
		droneDao.deleteDrone(drone);
	}

}
